//
//  ZZIAPRequest.h
//  zz-IAPHelper
//
//  Created by ZengLiZhi on 2024/4/3.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import "ZZIAPHander.h"

NS_ASSUME_NONNULL_BEGIN

@class ZZIAPRequest;

typedef void(^ZZIAPCreatOrderCompletion)(ZZIAPRequest *request,NSString *orderId);
typedef void(^ZZIAPCompletionHandler)(ZZIAPRequest *request,ZZIAPRequestCode code,__nullable id obj);
//typedef void(^ZZIAPFailedHandler)(ZZIAPRequest *request,ZZIAPRequestCode code,id obj);

@interface ZZIAPRequest : NSObject
//自定义requestId
@property (nonatomic, strong) NSString *requestId;
//后端创建订单
@property (nonatomic, strong) NSString *orderId;
//区分哪个业务
@property (nonatomic, strong) NSString *payType;
//购买产品的productId
@property (nonatomic, strong) NSString *productId;
//支付流程完成
@property (nonatomic, strong) ZZIAPCompletionHandler completion;
////支付流程失败
//@property (nonatomic, strong) ZZIAPFailedHandler failedHandler;

//后端创建订单
- (void)creatOrder:(ZZIAPCreatOrderCompletion)completion;

@end

NS_ASSUME_NONNULL_END
